﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PortChat
{
    //an channel coding class for input strings
    class Encoder
    {
        //list of all valid possible codewords
        private List<String> lstCodeWords = new List<string>();
    
        //creates the list of valid codeWords
        public Encoder()
        {
            //lstCodeWords.Add("000");
            //lstCodeWords.Add("111");
            lstCodeWords.Add("00000000");
            lstCodeWords.Add("00000011");
            lstCodeWords.Add("00000101");
            lstCodeWords.Add("00000110");
            lstCodeWords.Add("00001001");
            lstCodeWords.Add("00001010");
            lstCodeWords.Add("00001100");
            lstCodeWords.Add("00001111");
            lstCodeWords.Add("00010001");
            lstCodeWords.Add("00010010");
            lstCodeWords.Add("00010100");
            lstCodeWords.Add("00010111");
            lstCodeWords.Add("00011000");
            lstCodeWords.Add("00011011");
            lstCodeWords.Add("00011101");
            lstCodeWords.Add("00011110");
            lstCodeWords.Add("00100001");
            lstCodeWords.Add("00100010");
            lstCodeWords.Add("00100100");
            lstCodeWords.Add("00100111");
            lstCodeWords.Add("00101000");
            lstCodeWords.Add("00101011");
            lstCodeWords.Add("00101101");
            lstCodeWords.Add("00101110");
            lstCodeWords.Add("00110000");
            lstCodeWords.Add("00110011");
            lstCodeWords.Add("00110101");
            lstCodeWords.Add("00110110");
            lstCodeWords.Add("00111001");
            lstCodeWords.Add("00111010");
            lstCodeWords.Add("00111100");
            lstCodeWords.Add("00111111");

            lstCodeWords.Add("01000001");
            lstCodeWords.Add("01000010");
            lstCodeWords.Add("01000100");
            lstCodeWords.Add("01000111");
            lstCodeWords.Add("01001000");
            lstCodeWords.Add("01001011");
            lstCodeWords.Add("01001101");
            lstCodeWords.Add("01001110");
            lstCodeWords.Add("01010000");
            lstCodeWords.Add("01010011");
            lstCodeWords.Add("01010101");
            lstCodeWords.Add("01010110");
            lstCodeWords.Add("01011001");
            lstCodeWords.Add("01011010");
            lstCodeWords.Add("01011100");
            lstCodeWords.Add("01011111");
            lstCodeWords.Add("01100000");
            lstCodeWords.Add("01100011");
            lstCodeWords.Add("01100101");
            lstCodeWords.Add("01100110");
            lstCodeWords.Add("01101001");
            lstCodeWords.Add("01101010");
            lstCodeWords.Add("01101100");
            lstCodeWords.Add("01101111");
            lstCodeWords.Add("01110001");
            lstCodeWords.Add("01110010");
            lstCodeWords.Add("01110100");
            lstCodeWords.Add("01110111");
            lstCodeWords.Add("01111000");
            lstCodeWords.Add("01111011");
            lstCodeWords.Add("01111101");
            lstCodeWords.Add("01111110");

            lstCodeWords.Add("10000001");
            lstCodeWords.Add("10000010");
            lstCodeWords.Add("10000100");
            lstCodeWords.Add("10000111");
            lstCodeWords.Add("10001000");
            lstCodeWords.Add("10001011");
            lstCodeWords.Add("10001101");
            lstCodeWords.Add("10001110");
            lstCodeWords.Add("10010000");
            lstCodeWords.Add("10010011");
            lstCodeWords.Add("10010101");
            lstCodeWords.Add("10010110");
            lstCodeWords.Add("10011001");
            lstCodeWords.Add("10011010");
            lstCodeWords.Add("10011100");
            lstCodeWords.Add("10011111");
            lstCodeWords.Add("10100000");
            lstCodeWords.Add("10100011");
            lstCodeWords.Add("10100101");
            lstCodeWords.Add("10100110");
            lstCodeWords.Add("10101001");
            lstCodeWords.Add("10101010");
            lstCodeWords.Add("10101100");
            lstCodeWords.Add("10101111");
            lstCodeWords.Add("10110001");
            lstCodeWords.Add("10110010");
            lstCodeWords.Add("10110100");
            lstCodeWords.Add("10110111");
            lstCodeWords.Add("10111000");
            lstCodeWords.Add("10111011");
            lstCodeWords.Add("10111101");
            lstCodeWords.Add("10111110");

            lstCodeWords.Add("11000000");
            lstCodeWords.Add("11000011");
            lstCodeWords.Add("11000101");
            lstCodeWords.Add("11000110");
            lstCodeWords.Add("11001001");
            lstCodeWords.Add("11001010");
            lstCodeWords.Add("11001100");
            lstCodeWords.Add("11001111");
            lstCodeWords.Add("11010001");
            lstCodeWords.Add("11010010");
            lstCodeWords.Add("11010100");
            lstCodeWords.Add("11010111");
            lstCodeWords.Add("11011000");
            lstCodeWords.Add("11011011");
            lstCodeWords.Add("11011101");
            lstCodeWords.Add("11011110");
            lstCodeWords.Add("11100001");
            lstCodeWords.Add("11100010");
            lstCodeWords.Add("11100100");
            lstCodeWords.Add("11100111");
            lstCodeWords.Add("11101000");
            lstCodeWords.Add("11101011");
            lstCodeWords.Add("11101101");
            lstCodeWords.Add("11101110");
            lstCodeWords.Add("11110000");
            lstCodeWords.Add("11110011");
            lstCodeWords.Add("11110101");
            lstCodeWords.Add("11110110");
            lstCodeWords.Add("11111001");
            lstCodeWords.Add("11111010");
            lstCodeWords.Add("11111100");
            lstCodeWords.Add("11111111");
        }

        //for channel coding an input string
        public String encode(String strCodeL)
        {
            String strCode = strCodeL;
            //if (strCodeL.Equals("a")) {strCode = "000";}
            //else if (strCodeL.Equals("b")) { strCode = "111"; }
            if (strCodeL.Equals("")) { strCode = "00000000"; }
            else if (strCodeL.Equals("")) { strCode = "00000011"; }
            else if (strCodeL.Equals("")) { strCode = "00000101"; }
            else if (strCodeL.Equals("")) { strCode = "00000110"; }
            else if (strCodeL.Equals("")) { strCode = "00001001"; }
            else if (strCodeL.Equals("")) { strCode = "00001010"; }
            else if (strCodeL.Equals("")) { strCode = "00001100"; }
            else if (strCodeL.Equals("")) { strCode = "00001111"; }
            else if (strCodeL.Equals("")) { strCode = "00010001"; }
            else if (strCodeL.Equals("")) { strCode = "00010010"; }
            else if (strCodeL.Equals("")) { strCode = "00010100"; }
            else if (strCodeL.Equals("")) { strCode = "00010111"; }
            else if (strCodeL.Equals("")) { strCode = "00011000"; }
            else if (strCodeL.Equals("")) { strCode = "00011011"; }
            else if (strCodeL.Equals("")) { strCode = "00011101"; }
            else if (strCodeL.Equals("")) { strCode = "00011110"; }
            else if (strCodeL.Equals("")) { strCode = "00100001"; }
            else if (strCodeL.Equals("")) { strCode = "00100010"; }
            else if (strCodeL.Equals("")) { strCode = "00100100"; }
            else if (strCodeL.Equals("")) { strCode = "00100111"; }
            else if (strCodeL.Equals("")) { strCode = "00101000"; }
            else if (strCodeL.Equals("")) { strCode = "00101011"; }
            else if (strCodeL.Equals("")) { strCode = "00101101"; }
            else if (strCodeL.Equals("")) { strCode = "00101110"; }
            else if (strCodeL.Equals("")) { strCode = "00110000"; }
            else if (strCodeL.Equals("")) { strCode = "00110011"; }
            else if (strCodeL.Equals("")) { strCode = "00110101"; }
            else if (strCodeL.Equals("")) { strCode = "00110110"; }
            else if (strCodeL.Equals("")) { strCode = "00111001"; }
            else if (strCodeL.Equals("")) { strCode = "00111010"; }
            else if (strCodeL.Equals("")) { strCode = "00111100"; }
            else if (strCodeL.Equals("")) { strCode = "00111111"; }
            else if (strCodeL.Equals("")) { strCode = ""; }
            //32
            else if (strCodeL.Equals("")) { strCode = "01000001"; }
            else if (strCodeL.Equals("!")) { strCode = "01000010"; }
            else if (strCodeL.Equals("\"")) { strCode = "01000100"; }
            else if (strCodeL.Equals("#")) { strCode = "01000111"; }
            else if (strCodeL.Equals("$")) { strCode = "01001000"; }
            else if (strCodeL.Equals("%")) { strCode = "01001011"; }
            else if (strCodeL.Equals("&")) { strCode = "01001101"; }
            else if (strCodeL.Equals(" ")) { strCode = "01001110"; }
            else if (strCodeL.Equals("(")) { strCode = "01010000"; }
            else if (strCodeL.Equals(")")) { strCode = "01010011"; }
            else if (strCodeL.Equals("*")) { strCode = "01010101"; }
            else if (strCodeL.Equals("+")) { strCode = "01010110"; }
            else if (strCodeL.Equals(",")) { strCode = "01011001"; }
            else if (strCodeL.Equals("-")) { strCode = "01011010"; }
            else if (strCodeL.Equals(".")) { strCode = "01011100"; }
            else if (strCodeL.Equals("/")) { strCode = "01011111"; }
            else if (strCodeL.Equals("0")) { strCode = "01100000"; }
            else if (strCodeL.Equals("1")) { strCode = "01100011"; }
            else if (strCodeL.Equals("2")) { strCode = "01100101"; }
            else if (strCodeL.Equals("3")) { strCode = "01100110"; }
            else if (strCodeL.Equals("4")) { strCode = "01101001"; }
            else if (strCodeL.Equals("5")) { strCode = "01101010"; }
            else if (strCodeL.Equals("6")) { strCode = "01101100"; }
            else if (strCodeL.Equals("7")) { strCode = "01101111"; }
            else if (strCodeL.Equals("8")) { strCode = "01110001"; }
            else if (strCodeL.Equals("9")) { strCode = "01110010"; }
            else if (strCodeL.Equals(":")) { strCode = "01110100"; }
            else if (strCodeL.Equals(";")) { strCode = "01110111"; }
            else if (strCodeL.Equals("<")) { strCode = "01111000"; }
            else if (strCodeL.Equals("=")) { strCode = "01111011"; }
            else if (strCodeL.Equals(">")) { strCode = "01111101"; }
            else if (strCodeL.Equals("?")) { strCode = "01111110"; }
            //64
            else if (strCodeL.Equals("@")) { strCode = "10000001"; }
            else if (strCodeL.Equals("A")) { strCode = "10000010"; }
            else if (strCodeL.Equals("B")) { strCode = "10000100"; }
            else if (strCodeL.Equals("C")) { strCode = "10000111"; }
            else if (strCodeL.Equals("D")) { strCode = "10001000"; }
            else if (strCodeL.Equals("E")) { strCode = "10001011"; }
            else if (strCodeL.Equals("F")) { strCode = "10001101"; }
            else if (strCodeL.Equals("G")) { strCode = "10001110"; }
            else if (strCodeL.Equals("H")) { strCode = "10010000"; }
            else if (strCodeL.Equals("I")) { strCode = "10010011"; }
            else if (strCodeL.Equals("J")) { strCode = "10010101"; }
            else if (strCodeL.Equals("K")) { strCode = "10010110"; }
            else if (strCodeL.Equals("L")) { strCode = "10011001"; }
            else if (strCodeL.Equals("M")) { strCode = "10011010"; }
            else if (strCodeL.Equals("N")) { strCode = "10011100"; }
            else if (strCodeL.Equals("O")) { strCode = "10011111"; }
            else if (strCodeL.Equals("P")) { strCode = "10100000"; }
            else if (strCodeL.Equals("Q")) { strCode = "10100011"; }
            else if (strCodeL.Equals("R")) { strCode = "10100101"; }
            else if (strCodeL.Equals("S")) { strCode = "10100110"; }
            else if (strCodeL.Equals("T")) { strCode = "10101001"; }
            else if (strCodeL.Equals("U")) { strCode = "10101010"; }
            else if (strCodeL.Equals("V")) { strCode = "10101100"; }
            else if (strCodeL.Equals("W")) { strCode = "10101111"; }
            else if (strCodeL.Equals("X")) { strCode = "10110001"; }
            else if (strCodeL.Equals("Y")) { strCode = "10110010"; }
            else if (strCodeL.Equals("Z")) { strCode = "10110100"; }
            else if (strCodeL.Equals("[")) { strCode = "10110111"; }
            else if (strCodeL.Equals("\\")) { strCode = "10111000"; }
            else if (strCodeL.Equals("]")) { strCode = "10111011"; }
            else if (strCodeL.Equals("^")) { strCode = "10111101"; }
            else if (strCodeL.Equals("_")) { strCode = "10111110"; }
            //96
            else if (strCodeL.Equals("`")) { strCode = "11000000"; }
            else if (strCodeL.Equals("a")) { strCode = "11000011"; }
            else if (strCodeL.Equals("b")) { strCode = "11000101"; }
            else if (strCodeL.Equals("c")) { strCode = "11000110"; }
            else if (strCodeL.Equals("d")) { strCode = "11001001"; }
            else if (strCodeL.Equals("e")) { strCode = "11001010"; }
            else if (strCodeL.Equals("f")) { strCode = "11001100"; }
            else if (strCodeL.Equals("g")) { strCode = "11001111"; }
            else if (strCodeL.Equals("h")) { strCode = "11010001"; }
            else if (strCodeL.Equals("i")) { strCode = "11010010"; }
            else if (strCodeL.Equals("j")) { strCode = "11010100"; }
            else if (strCodeL.Equals("k")) { strCode = "11010111"; }
            else if (strCodeL.Equals("l")) { strCode = "11011000"; }
            else if (strCodeL.Equals("m")) { strCode = "11011011"; }
            else if (strCodeL.Equals("n")) { strCode = "11011101"; }
            else if (strCodeL.Equals("o")) { strCode = "11011110"; }
            else if (strCodeL.Equals("p")) { strCode = "11100001"; }
            else if (strCodeL.Equals("q")) { strCode = "11100010"; }
            else if (strCodeL.Equals("r")) { strCode = "11100100"; }
            else if (strCodeL.Equals("s")) { strCode = "11100111"; }
            else if (strCodeL.Equals("t")) { strCode = "11101000"; }
            else if (strCodeL.Equals("u")) { strCode = "11101011"; }
            else if (strCodeL.Equals("v")) { strCode = "11101101"; }
            else if (strCodeL.Equals("w")) { strCode = "11101110"; }
            else if (strCodeL.Equals("x")) { strCode = "11110000"; }
            else if (strCodeL.Equals("y")) { strCode = "11110011"; }
            else if (strCodeL.Equals("z")) { strCode = "11110101"; }
            else if (strCodeL.Equals("{")) { strCode = "11110110"; }
            else if (strCodeL.Equals("|")) { strCode = "11111001"; }
            else if (strCodeL.Equals("}")) { strCode = "11111010"; }
            else if (strCodeL.Equals("~")) { strCode = "11111100"; }
            else if (strCodeL.Equals("")) { strCode = "11111111"; }
           
            return strCode;
        }

        public String decode(String strCodeL)
        {
            String strCode = strCodeL;
            //if (strCodeL.Equals("000")) { strCode = "a"; } 
            //else if (strCodeL.Equals("111")) { strCode = "b"; }


            if (strCodeL.Equals("")) { strCode = ""; }
            else if (strCodeL.Equals("00000011")) { strCode = ""; }
            else if (strCodeL.Equals("00000101")) { strCode = ""; }
            else if (strCodeL.Equals("00000110")) { strCode = ""; }
            else if (strCodeL.Equals("00001001")) { strCode = ""; }
            else if (strCodeL.Equals("00001010")) { strCode = ""; }
            else if (strCodeL.Equals("00001100")) { strCode = ""; }
            else if (strCodeL.Equals("00001111")) { strCode = ""; }
            else if (strCodeL.Equals("00010001")) { strCode = ""; }
            else if (strCodeL.Equals("00010010")) { strCode = ""; }
            else if (strCodeL.Equals("00010100")) { strCode = ""; }
            else if (strCodeL.Equals("00010111")) { strCode = ""; }
            else if (strCodeL.Equals("00011000")) { strCode = ""; }
            else if (strCodeL.Equals("00011011")) { strCode = ""; }
            else if (strCodeL.Equals("00011101")) { strCode = ""; }
            else if (strCodeL.Equals("00011110")) { strCode = ""; }
            else if (strCodeL.Equals("00100001")) { strCode = ""; }
            else if (strCodeL.Equals("00100010")) { strCode = ""; }
            else if (strCodeL.Equals("00100100")) { strCode = ""; }
            else if (strCodeL.Equals("00100111")) { strCode = ""; }
            else if (strCodeL.Equals("00101000")) { strCode = ""; }
            else if (strCodeL.Equals("00101011")) { strCode = ""; }
            else if (strCodeL.Equals("00101101")) { strCode = ""; }
            else if (strCodeL.Equals("00101110")) { strCode = ""; }
            else if (strCodeL.Equals("00110000")) { strCode = ""; }
            else if (strCodeL.Equals("00110011")) { strCode = ""; }
            else if (strCodeL.Equals("00110101")) { strCode = ""; }
            else if (strCodeL.Equals("00110110")) { strCode = ""; }
            else if (strCodeL.Equals("00111001")) { strCode = ""; }
            else if (strCodeL.Equals("00111010")) { strCode = ""; }
            else if (strCodeL.Equals("00111100")) { strCode = ""; }
            else if (strCodeL.Equals("00111111")) { strCode = ""; }
            //32
            else if (strCodeL.Equals("01000001")) { strCode = ""; }
            else if (strCodeL.Equals("01000010")) { strCode = "!"; }
            else if (strCodeL.Equals("01000100")) { strCode = "\""; }
            else if (strCodeL.Equals("01000111")) { strCode = "#"; }
            else if (strCodeL.Equals("01001000")) { strCode = "$"; }
            else if (strCodeL.Equals("01001011")) { strCode = "%"; }
            else if (strCodeL.Equals("01001101")) { strCode = "&"; }
            else if (strCodeL.Equals("01001110")) { strCode = " "; }
            else if (strCodeL.Equals("01010000")) { strCode = "("; }
            else if (strCodeL.Equals("01010011")) { strCode = ")"; }
            else if (strCodeL.Equals("01010101")) { strCode = "*"; }
            else if (strCodeL.Equals("01010110")) { strCode = "+"; }
            else if (strCodeL.Equals("01011001")) { strCode = ","; }
            else if (strCodeL.Equals("01011010")) { strCode = "-"; }
            else if (strCodeL.Equals("01011100")) { strCode = "."; }
            else if (strCodeL.Equals("01011111")) { strCode = "/"; }
            else if (strCodeL.Equals("01100000")) { strCode = "0"; }
            else if (strCodeL.Equals("01100011")) { strCode = "1"; }
            else if (strCodeL.Equals("01100101")) { strCode = "2"; }
            else if (strCodeL.Equals("01100110")) { strCode = "3"; }
            else if (strCodeL.Equals("01101001")) { strCode = "4"; }
            else if (strCodeL.Equals("01101010")) { strCode = "5"; }
            else if (strCodeL.Equals("01101100")) { strCode = "6"; }
            else if (strCodeL.Equals("01101111")) { strCode = "7"; }
            else if (strCodeL.Equals("01110001")) { strCode = "8"; }
            else if (strCodeL.Equals("01110010")) { strCode = "9"; }
            else if (strCodeL.Equals("01110100")) { strCode = ":"; }
            else if (strCodeL.Equals("01110111")) { strCode = ";"; }
            else if (strCodeL.Equals("01111000")) { strCode = "<"; }
            else if (strCodeL.Equals("01111011")) { strCode = "="; }
            else if (strCodeL.Equals("01111101")) { strCode = ">"; }
            else if (strCodeL.Equals("01111110")) { strCode = "?"; }
            //64
            else if (strCodeL.Equals("10000001")) { strCode = "@"; }
            else if (strCodeL.Equals("10000010")) { strCode = "A"; }
            else if (strCodeL.Equals("10000100")) { strCode = "B"; }
            else if (strCodeL.Equals("10000111")) { strCode = "C"; }
            else if (strCodeL.Equals("10001000")) { strCode = "D"; }
            else if (strCodeL.Equals("10001011")) { strCode = "E"; }
            else if (strCodeL.Equals("10001101")) { strCode = "F"; }
            else if (strCodeL.Equals("10001110")) { strCode = "G"; }
            else if (strCodeL.Equals("10010000")) { strCode = "H"; }
            else if (strCodeL.Equals("10010011")) { strCode = "I"; }
            else if (strCodeL.Equals("10010101")) { strCode = "J"; }
            else if (strCodeL.Equals("10010110")) { strCode = "K"; }
            else if (strCodeL.Equals("10011001")) { strCode = "L"; }
            else if (strCodeL.Equals("10011010")) { strCode = "M"; }
            else if (strCodeL.Equals("10011100")) { strCode = "N"; }
            else if (strCodeL.Equals("10011111")) { strCode = "O"; }
            else if (strCodeL.Equals("10100000")) { strCode = "P"; }
            else if (strCodeL.Equals("10100011")) { strCode = "Q"; }
            else if (strCodeL.Equals("10100101")) { strCode = "R"; }
            else if (strCodeL.Equals("10100110")) { strCode = "S"; }
            else if (strCodeL.Equals("10101001")) { strCode = "T"; }
            else if (strCodeL.Equals("10101010")) { strCode = "U"; }
            else if (strCodeL.Equals("10101100")) { strCode = "V"; }
            else if (strCodeL.Equals("10101111")) { strCode = "W"; }
            else if (strCodeL.Equals("10110001")) { strCode = "X"; }
            else if (strCodeL.Equals("10110010")) { strCode = "Y"; }
            else if (strCodeL.Equals("10110100")) { strCode = "Z"; }
            else if (strCodeL.Equals("10110111")) { strCode = "["; }
            else if (strCodeL.Equals("10111000")) { strCode = "\\"; }
            else if (strCodeL.Equals("10111011")) { strCode = "]"; }
            else if (strCodeL.Equals("10111101")) { strCode = "^"; }
            else if (strCodeL.Equals("10111110")) { strCode = "_"; }
            //96
            else if (strCodeL.Equals("11000000")) { strCode = "`"; }
            else if (strCodeL.Equals("11000011")) { strCode = "a"; }
            else if (strCodeL.Equals("11000101")) { strCode = "b"; }
            else if (strCodeL.Equals("11000110")) { strCode = "c"; }
            else if (strCodeL.Equals("11001001")) { strCode = "d"; }
            else if (strCodeL.Equals("11001010")) { strCode = "e"; }
            else if (strCodeL.Equals("11001100")) { strCode = "f"; }
            else if (strCodeL.Equals("11001111")) { strCode = "g"; }
            else if (strCodeL.Equals("11010001")) { strCode = "h"; }
            else if (strCodeL.Equals("11010010")) { strCode = "i"; }
            else if (strCodeL.Equals("11010100")) { strCode = "j"; }
            else if (strCodeL.Equals("11010111")) { strCode = "k"; }
            else if (strCodeL.Equals("11011000")) { strCode = "l"; }
            else if (strCodeL.Equals("11011011")) { strCode = "m"; }
            else if (strCodeL.Equals("11011101")) { strCode = "n"; }
            else if (strCodeL.Equals("11011110")) { strCode = "o"; }
            else if (strCodeL.Equals("11100001")) { strCode = "p"; }
            else if (strCodeL.Equals("11100010")) { strCode = "q"; }
            else if (strCodeL.Equals("11100100")) { strCode = "r"; }
            else if (strCodeL.Equals("11100111")) { strCode = "s"; }
            else if (strCodeL.Equals("11101000")) { strCode = "t"; }
            else if (strCodeL.Equals("11101011")) { strCode = "u"; }
            else if (strCodeL.Equals("11101101")) { strCode = "v"; }
            else if (strCodeL.Equals("11101110")) { strCode = "w"; }
            else if (strCodeL.Equals("11110000")) { strCode = "x"; }
            else if (strCodeL.Equals("11110011")) { strCode = "y"; }
            else if (strCodeL.Equals("11110101")) { strCode = "z"; }
            else if (strCodeL.Equals("11110110")) { strCode = "{"; }
            else if (strCodeL.Equals("11111001")) { strCode = "|"; }
            else if (strCodeL.Equals("11111010")) { strCode = "}"; }
            else if (strCodeL.Equals("11111100")) { strCode = "~"; }
            else if (strCodeL.Equals("11111111")) { strCode = ""; }

            return strCode;
        }

        //gives the list of valid code words
        public List<String> getCodeWords()
        {
            return lstCodeWords;
        }

        public Boolean isCodeWord(String strWord)
        {
            return lstCodeWords.Contains(strWord);
        }

        public String getCodeWordWithError(List<String> lstCodeWordsP)
        {
            String strNoCodeWord = "";
            //find the codeword which has an error
            foreach (String myStrWord in lstCodeWordsP)
            {                
                if (!isCodeWord(myStrWord))
                {
                    strNoCodeWord = myStrWord;
                }
            }
            return strNoCodeWord;
        }

    }
}